%define catrustdir %{_sysconfdir}/pki/ca-trust

Summary:	Bundle of CA Root Certificates for MOS
Name:		mos-certs-pack
Version:	0.20240625
Release:	1
License:	GPL
Group:		System/Servers
URL:		https://hub.mos.ru/mos/pkgs/mos-certs-pack
Source0:	https://moscow.roskazna.gov.ru/upload/iblock/a3f/guts_2012.cer
Source1:	https://moscow.roskazna.gov.ru/upload/iblock/f9f/Kornevoy_sertifikat_GUTS_2022.CER
Source2:	https://moscow.roskazna.gov.ru/upload/iblock/ab1/uts_fk_2020.cer
Source3:	https://moscow.roskazna.gov.ru/upload/iblock/7dc/FK_GUC.cer
Source4:	https://moscow.roskazna.gov.ru/upload/iblock/6d4/Sertifikat-udostoveryayushchego-tsentra-Federalnogo-kaznacheystva-2024.cer
Source5:	https://moscow.roskazna.gov.ru/upload/iblock/ea6/fk_2012.cer
BuildArch:	noarch
Supplements:	rootcerts-russia
# TODO: file trigger in rootcerts
Requires(post):	%{_bindir}/update-ca-trust
Requires(postun):	%{_bindir}/update-ca-trust

%description
%{summary}.

%files
%{catrustdir}/source/anchors/*

%post
%{_bindir}/update-ca-trust

%postun
%{_bindir}/update-ca-trust

#--------------------------------------------------------------------

%prep
%setup -q -T -c

%install
mkdir -p -m 755 %{buildroot}%{catrustdir}/source/anchors
install -m0644 %{sources} %{buildroot}%{catrustdir}/source/anchors/
